Skip to content

Fix create_parameter_df crash for BNGL expression parameters - #620

Closed
dweindl wants to merge 1 commit into
PEtab-dev:mainfrom
dweindl:bngl-derived-parameter-value
Closed

dweindl wants to merge 1 commit into
PEtab-dev:mainfrom
dweindl:bngl-derived-parameter-value

Conversation

@dweindl

@dweindl dweindl commented Nov 23, 2026

Copy link
Copy Markdown
Member

BnglModel.get_parameter_value raised NotImplementedError for parameters defined by an expression (e.g. b 2*a). create_parameter_df only catches ValueError, so it crashed for such BNGL models.

get_parameter_value now raises the new DerivedValueError, a subclass of both ValueError and NotImplementedError, so existing handlers of either keep working. create_parameter_df leaves the nominal value of such parameters empty. DerivedValueError is exported from petab.v1.models (and petab.v2.models).

🤖 Generated with Claude Code

`BnglModel.get_parameter_value` raised `NotImplementedError` for
parameters defined by an expression, which `create_parameter_df` did not
catch. Raise the new `DerivedValueError`, a subclass of both
`ValueError` and `NotImplementedError`, instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dweindl
dweindl force-pushed the bngl-derived-parameter-value branch from 38cd666 to c3e5254 Compare November 23, 2026 11:19
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.16%. Comparing base (d21ee3b) to head (c3e5254).

Files with missing lines Patch % Lines
petab/v1/parameter_mapping.py 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #620      +/-   ##
==========================================
- Coverage   80.18%   80.16%   -0.02%     
==========================================
  Files          70       70              
  Lines        8442     8446       +4     
  Branches     1544     1544              
==========================================
+ Hits         6769     6771       +2     
- Misses       1182     1184       +2     
  Partials      491      491              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dweindl

dweindl commented Nov 23, 2026

Copy link
Copy Markdown
Member Author

Closing: BnglModel is only supported with PEtab v2, and v2 never calls get_parameter_value, so the v1 code paths don't need to handle BNGL expression parameters. 🤖

@dweindl dweindl closed this Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants